Getting Ready: The ATM System
Understand the ATM design problem and learn the questions to simplify this problem further.
Problem definition#
An Automated teller machine (ATM) allows a bank customer to perform financial transactions remotely without the need for a teller or a bank branch. These transactions include deposits, withdrawals, balance inquiries, and account transfers. ATMs are located in convenient locations such as banks, grocery stores, airports, and other public places.
To use an ATM, users need a bank card associated with an account at a financial institution to use an ATM. To access their account, users must also know the personal identification number (PIN). The user can follow the prompts on the ATM's screen to complete the desired transaction with the PIN.
1 of 18
2 of 18
3 of 18
4 of 18
5 of 18
6 of 18
7 of 18
8 of 18
9 of 18
10 of 18
11 of 18
12 of 18
13 of 18
14 of 18
15 of 18
16 of 18
17 of 18
18 of 18
Expectations from the interviewee#
There are several components in an ATM design, each with specific constraints and requirements. The following provides an overview of some of the main expectations that the interviewer will want to hear you discuss in more detail, during the interview.
ATM components #
To better understand an ATM system, you may ask the interviewer the following questions:
What are the components of an ATM?
Is the ATM necessarily placed inside a room?
Does an ATM have a fingerprint scanner?
ATM features#
Different ATMs may vary in terms of features which is why it is important to clear the following questions from the interviewer:
What is the withdrawal limit of an ATM?
Can we check our account balance using an ATM?
Can we set a PIN using an ATM?
ATM processing#
The interviewer would expect you to ask a question regarding the processing of transactions using an ATM. Therefore, you may ask the following questions:
What happens when the amount entered by the user for withdrawal is greater than the user's account balance?
What happens when the amount entered by the user for withdrawal is greater than the ATM's cash limit?
What happens when the amount entered by the user exceeds the total cash present in the ATM?
Can the ATM be used for online transactions?
Design approach#
We are going to design this ATM system using the bottom-up design approach. For this purpose, we will follow the steps below:
Identify and design the smallest components first—the screen, keypad, cash dispenser, printer, and card reader.
Use these small components to design bigger ATM components—the state, machine, and room.
Repeat the steps above until we design the whole ATM system.
Design pattern #
During an interview, it is always a good practice to discuss the design patterns that a parking lot system falls under. Stating the design patterns gives the interviewer a positive impression and shows that the interviewee is well-versed in the advanced concepts of object-oriented design.
Try to answer the following question. If you are not familiar with design patterns, don’t worry! You can learn about them by asking questions like, “Define design patterns.”
Please enter the correct design pattern(s)
Let’s explore the requirements of the ATM system in the next lesson.
Code for the Car Rental System
Requirements for the ATM System